package Day08.Demo02;

/**
 * @author HYHwtx
 * @version 1.0
 * @date 2022/2/13 19:14
 */
public class Demo03SubString {
    public static void main(String[] args) {
        String str1 = "HelloWorld";
        String str2 = str1.substring(5);
        System.out.println(str1);
        System.out.println(str2);
        System.out.println("==========");

        String str3 = str1.substring(4,7);
        System.out.println(str3);
        System.out.println("==========");

        //下面这种写法，字符串的内容仍然是没有改变的
        String strA = "Hello";
        System.out.println(strA);
        strA = "Java";
        System.out.println(strA);
    }

}
